<?php

namespace App\Http\Controllers\Fang;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\DB;

class FangController extends Controller
{
    //路由设置
/*
 * Route::prefix('fang')->group(function () {
    Route::get('create', 'Fang\FangController@create');
    Route::post('createdata', 'Fang\FangController@createData');
    Route::any('pid', 'Fang\FangController@pid');
});
*/
    //添加页面
    public function create(Request $request){
        $data=DB::table('zfw_cities')->where('pid',0)->get();
        return view('fang.create',['data'=>$data]);
    }
    public function createData(Request $request){


    }
    public function pid(Request $request){
        $id=$request->post('id');
        $data=DB::table('zfw_cities')->where('pid',$id)->get();
        return ['code'=>200,'msg'=>'查询成功','data'=>$data];
    }

}
